import Redis from 'ioredis';

const instance = (database: number) => new Redis({
  host: process.env.REDIS_HOST,
  port: Number(process.env.REDIS_PORT),
  family: Number(process.env.REDIS_FAMILY),
  password: process.env.REDIS_PASSWORD,
  db: database,
});

export const RedisDB = instance(0);
